package com.boot.security.server.dao;

import com.boot.security.server.model.OverseeQuestion;
import com.boot.security.server.model.domain.MOverseeQuestion;
import com.boot.security.server.model.param.OverseeQuestionParam;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface MOverseeQuestionDao {

    @Select("select * from m_oversee_question t where t.id = #{id}")
    OverseeQuestion getById(Long id);

    @Delete("delete from m_oversee_question where id = #{id}")
    int delete(Long id);

    int update(OverseeQuestion mOverseeQuestion);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into m_oversee_question(question, branch, question_type, start_patrol_time, end_patrol_time, question_keyword, question_status, create_time, update_time, oversee, oversee_form, question_detail, remark, oversee_id, branch_id) values(#{question}, #{branch}, #{questionType}, #{startPatrolTime}, #{endPatrolTime}, #{questionKeyword}, #{questionStatus}, #{createTime}, #{updateTime}, #{oversee}, #{overseeForm}, #{questionDetail}, #{remark}, #{overseeId}, #{branchId})")
    int save(OverseeQuestion mOverseeQuestion);
    
    int count(@Param("params") Map<String, Object> params);
    int countList(@Param("params") Map<String, Object> params);

    List<OverseeQuestion> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
    List<OverseeQuestion> excelList(@Param("params") Map<String, Object> params);

    List<MOverseeQuestion> allList(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);


    List<OverseeQuestion> getList(@Param("params") OverseeQuestionParam param);

    List<OverseeQuestion> findByStatus();


    List<OverseeQuestion> excelIds(@Param("integers") List<Integer> integers);
}
